package org.jeecg.modules.demo.weixin.merchantpay.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.weixin.merchantpay.mapper.MerchantPayMapper;
import org.jeecg.modules.demo.weixin.merchantpay.service.IMerchantPayService;
import org.jeecg.modules.demo.weixin.entity.MerchantPay;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 商家支付管理
 * @Author: jeecg-boot
 * @Date: 2023-11-04
 * @Version: V1.0
 */
@Service
public class MerchantPayServiceImpl extends ServiceImpl<MerchantPayMapper, MerchantPay> implements IMerchantPayService {

    @Override
    public MerchantPay getByMerchantId(Integer merId) {
        LambdaQueryWrapper<MerchantPay> lqw = new LambdaQueryWrapper<>();
        lqw.eq(MerchantPay::getMerchantId, merId);
        List<MerchantPay> payList = this.list(lqw);
        return !payList.isEmpty() ? payList.get(0) : null;
    }
}
